package com.ruoyi.web.controller.bigScreen;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.common.utils.ServletUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.config.ServerConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;

/**
 * 通用请求处理
 *
 * @author chenzhuo
 */
@Controller
public class BigScreenController {
    @Autowired
    private SimpMessagingTemplate messagingTemplate; // 通过messagingTemplate向浏览器发送消息

    @GetMapping("/bigScreen")
    public String bigScreen(HttpServletRequest request, HttpServletResponse response)
    {
        return "bigScreen";
    }

    @GetMapping("/refreshbigScreen")
    @ResponseBody
    public AjaxResult refreshbigScreen(HttpServletRequest request, HttpServletResponse response)
    {
        messagingTemplate.convertAndSend("/topic/publishNewOrder_WebSocket","Refresh");
        return AjaxResult.success("网页刷新成功");
    }
}
